<template>
	<div class="myInput-box">
		<p class="title">{{title?title:'标题'}}</p>
		<input :maxlength="maxlength?maxlength:20" class="myInput" @blur="blurFn" :type="type?type:'text'" :placeholder="placeholder?placeholder:'请输入'" ref="inp" />
	
	</div>
</template>

<script>
export default {
	name: 'myInput',
	props: ['title', 'type', 'placeholder','maxlength'],
	methods: {
		blurFn() {
			let inputVal = this.$refs.inp.value;
			this.$emit('inputBlur', inputVal);
			// this.$refs.inp.value="";
		}
	}
};
</script>

<style>
	*{
		padding: 0;
		margin: 0;
		box-sizing: border-box;
	}
	.myInput-box{
		width: 100%;
		height: 0.88rem;
		background-color: white;
		display: flex;
		align-items: center;
		border: 0.01rem solid #e2e2e2;
	}
	.title{
		width: 1.4rem;
		height:100%;
		display: flex;
		align-items: center;
		justify-content: center;
		color: black;
		font-size: 0.32rem;
	}
	.myInput-box input{
		height: 96%;
		width: 80%;
		border: none;
		padding-left: 0.25rem ;
		font-size: 0.28rem;
	}
	
</style>
